package com.yunji.storage.service.impl;

import com.yunji.storage.bo.StockListQueryBO;
import com.yunji.storage.bo.StockSelectQueryBO;
import com.yunji.storage.dao.IStockDao;
import com.yunji.storage.domain.StockDO;
import com.yunji.storage.mapper.StockMapper;
import com.yunji.storage.service.IStockService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.storage.service.impl
 * @Title: StockServiceImpl
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-08-15 15:59:56      V1.0        HuaAo       新建类
 */
@Service
public class StockServiceImpl implements IStockService {

    @Resource
    StockMapper stockMapper;

    @Resource
    IStockDao stockDao;

    @Override
    public List<StockDO> search(StockListQueryBO bo) {
        return stockDao.search(bo);
    }

    @Override
    public boolean create(StockDO stock) {
        return stockDao.create(stock);
    }

    @Override
    public boolean updateStock(StockDO stock) {
        return stockDao.updateStock(stock);
    }

    @Override
    public StockDO select(StockSelectQueryBO bo) {
        return stockDao.select(bo);
    }

    @Override
    public StockDO select(StockDO stockDO) {
        return stockDao.selectStock(stockDO);
    }

    @Override
    public StockDO select(Long stockId) {
        return stockDao.getById(stockId);
    }

    @Override
    public boolean update(StockDO update) {
        return stockDao.edit(update);
    }

    @Override
    public boolean deleteEmptyStock(Long... ids) {
        return stockDao.deleteEmptyStock(ids);
    }


}